package game;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;

public class LoaderFile extends Scene
{
	Font font = new Font ("Andy", Font.PLAIN, 30);
	int indexImagemCarregando = 0;
	String strCarregando = "";
	
	public LoaderFile(){}
	
	@Override
	public void update() {}

	@Override
	public void draw(Graphics2D g2d) 
	{
		//Audios.getInstance().stopAll();
		//g2d.drawImage(LoadImages.getImage(this.indexImagemCarregando), 1000, 1000, 10000, 10000, null);
		g2d.setColor(Color.DARK_GRAY);
		g2d.fillRect(0, 0, Game.screenWidth, Game.screenHeigth);
		g2d.setColor(Color.WHITE);
		g2d.setFont(font);
		
		switch(this.indexImagemCarregando%16)
		{
			case 0:
				this.strCarregando = "Loading";
				break;
			case 4:
				this.strCarregando = "Loading.";
				break;
			case 8:
				this.strCarregando = "Loading..";
				break;
			case 12:
				this.strCarregando = "Loading...";
				break;
		}
		g2d.drawString(this.strCarregando, 350, 280);
		
		
		this.indexImagemCarregando++;
		
		if(this.indexImagemCarregando >= LoadImages.getInstance().stImages.length)
			SceneManager.changeScene(2);

	}

}
